"""meet"""
import httpx

HOSTNAME = "http://192.168.100.120:9009"


def room_list():
    """会议室列表"""
    url =  f"{HOSTNAME}/smartRoom/v1/room/search"
    return httpx.post(url).json()


def device_list():
    """设备列表"""
    url =  f"{HOSTNAME}/smartRoom/v1/device/search"
    return httpx.get(url).json()


def room_store(data):
    """添加｜修改 会议室"""
    url = f"{HOSTNAME}/smartRoom/v1/room/save"
    return httpx.post(url, json=data).json()


def room_destroy(data):
    """删除会议室"""
    url = f"{HOSTNAME}/smartRoom/v1/room/deletion"
    return httpx.post(url, json=data).json()


def room_device_store(data):
    """会议室关联设备"""
    url = f"{HOSTNAME}/smartRoom/v1/room/relatedDevices"
    return httpx.post(url, json=data).json()
